<template>
  <van-swipe
    class="my-swipe"
    :autoplay="3000"
    indicator-color="white"
    :loop="true"
  >
    <van-swipe-item
      class="img_box"
      v-for="(image, index) in images"
      :key="index"
      @click="output(index)"
    >
      <img :src="image" />
    </van-swipe-item>
  </van-swipe>
</template>
<script setup lang="ts">
const images = [
  "../src/assets/1.jpg",
  "../src/assets/2.png",
  "../src/assets/3.png",
  "../src/assets/4.png",
];
const output = (index: any) => {
  console.log(index);
};
</script>
<style scoped lang="less">
.my-swipe {
  width: 100vw;
  border-radius: 0% 0% 4% 4%; //上方下圆
  img {
    display: block;
    width: 100vw;
    margin: auto; // 居中显示图片
  }
}
</style>
